import os, zipfile
import os.path as op
from configobj import ConfigObj

def build_zip(version):
    zf = zipfile.ZipFile('cycloctopus-%s.zip' % version, 'w')
    for root, dirs, files in os.walk('dist'):
        dirname = 'cycloctopus' + root[4:]
        
        for f in files:
            dest = op.join(dirname, f)
            zf.write(op.join(root, f), dest)
            print dest

    zf.close()

if __name__ == '__main__':
    cfg = ConfigObj('src/application.ini')
    version = cfg['App']['Version']
    print 'Version:  %s' % version
    
    build_zip(version)
        
                         
